import {fetchCates} from '@/api/good'
const state = {
  cateList: []
}

const mutations = {
  //更新品类列表
  UPDATE_CATE_LIST: (state, payload) => {
    state.cateList=payload
  },
}

const actions = {
  getCateList({commit},palyload){
      fetchCates({}).then(lists => {
        console.log(lists);
        var {list} = lists.data
        commit('UPDATE_CATE_LIST', list)
      })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
